/**
 * AMD PM4 packets.
 *
 * Copyright 2017-2021. Orbital project.
 * Released under MIT license. Read LICENSE for more details.
 *
 * Authors:
 * - Alexandro Sanchez Bach <alexandro@phi.nz>
 */

#include "pm4.h"

const char* pm4_itop_name(U32 itop) {
#define CASE(itop) case PM4_IT_##itop: return #itop
    switch (itop) {
    CASE(NOP);
    CASE(SET_BASE);
    CASE(CLEAR_STATE);
    CASE(INDEX_BUFFER_SIZE);
    CASE(DISPATCH_DIRECT);
    CASE(DISPATCH_INDIRECT);
    CASE(ATOMIC_GDS);
    CASE(OCCLUSION_QUERY);
    CASE(SET_PREDICATION);
    CASE(REG_RMW);
    CASE(COND_EXEC);
    CASE(PRED_EXEC);
    CASE(DRAW_INDIRECT);
    CASE(DRAW_INDEX_INDIRECT);
    CASE(INDEX_BASE);
    CASE(DRAW_INDEX_2);
    CASE(CONTEXT_CONTROL);
    CASE(INDEX_TYPE);
    CASE(DRAW_INDIRECT_MULTI);
    CASE(DRAW_INDEX_AUTO);
    CASE(NUM_INSTANCES);
    CASE(DRAW_INDEX_MULTI_AUTO);
    CASE(INDIRECT_BUFFER_CONST);
    CASE(STRMOUT_BUFFER_UPDATE);
    CASE(DRAW_INDEX_OFFSET_2);
    CASE(DRAW_PREAMBLE);
    CASE(WRITE_DATA);
    CASE(DRAW_INDEX_INDIRECT_MULTI);
    CASE(MEM_SEMAPHORE);
    CASE(COPY_DW);
    CASE(WAIT_REG_MEM);
    CASE(INDIRECT_BUFFER);
    CASE(COPY_DATA);
    CASE(PFP_SYNC_ME);
    CASE(SURFACE_SYNC);
    CASE(COND_WRITE);
    CASE(EVENT_WRITE);
    CASE(EVENT_WRITE_EOP);
    CASE(EVENT_WRITE_EOS);
    CASE(RELEASE_MEM);
    CASE(PREAMBLE_CNTL);
    CASE(DMA_DATA);
    CASE(ACQUIRE_MEM);
    CASE(REWIND);
    CASE(LOAD_UCONFIG_REG);
    CASE(LOAD_SH_REG);
    CASE(LOAD_CONFIG_REG);
    CASE(LOAD_CONTEXT_REG);
    CASE(SET_CONFIG_REG);
    CASE(SET_CONTEXT_REG);
    CASE(SET_CONTEXT_REG_INDIRECT);
    CASE(SET_SH_REG);
    CASE(SET_SH_REG_OFFSET);
    CASE(SET_QUEUE_REG);
    CASE(SET_UCONFIG_REG);
    CASE(SCRATCH_RAM_WRITE);
    CASE(SCRATCH_RAM_READ);
    CASE(LOAD_CONST_RAM);
    CASE(WRITE_CONST_RAM);
    CASE(DUMP_CONST_RAM);
    CASE(INCREMENT_CE_COUNTER);
    CASE(INCREMENT_DE_COUNTER);
    CASE(WAIT_ON_CE_COUNTER);
    CASE(WAIT_ON_DE_COUNTER_DIFF);
    CASE(SWITCH_BUFFER);
    CASE(SET_RESOURCES);
    CASE(MAP_PROCESS);
    CASE(MAP_QUEUES);
    CASE(UNMAP_QUEUES);
    CASE(QUERY_STATUS);
    CASE(RUN_LIST);
    default:
        return "???";
    }
#undef CASE
}
